package com.qiyi.database;

//	public static final String DATABASE_NAME = "points.db";//数据库名
//	public static final int DATABASE_VERSION = 2;				 //版本
//	public static final String TASK_TABLE = "task";	 //表名
 
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Debug;

public class DBHelper extends SQLiteOpenHelper {

	public static final String DATABASE_NAME = "qiyi.db";//数据库名
	public static final int DATABASE_VERSION = 2;				 //版本
	public DBHelper(Context context)
	{
		super(context, DATABASE_NAME,null, DATABASE_VERSION);
	}
	
	
	 
	@Override
	public void onCreate(SQLiteDatabase db) {
		String sql= 
				"CREATE TABLE course (  " +
				"  _id INTEGER PRIMARY KEY," +
				"  name TEXT    ,          " +
				"  parentid INTEGER  ,     " +
				"  leaf INTEGER  ,         " +
				"  sort_order INTEGER    , " +
				"  status INTEGER    ,     " +
				"  info text ,             " +
				"  url text ,              " +
				"  dateline INTEGER   ,    " +
				"  teacherid text ,        " +
				"  length INTEGER ,        " +
				"  path TEXT  ,            " +
				"  photo TEXT              " +
				")  ";
		db.execSQL(sql); 
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		
		String sql=" DROP TABLE IF EXISTS task ";
		db.execSQL(sql);
		onCreate(db);
	}

	
}
